﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIRecommend : MonoBehaviour
{

    public Text _TxtDate;
    public GameObject _ItemGameRecommend;
    void Start()
    {
        gameObject.GetComponent<RectTransform>().pivot = new Vector2(0.5F, 1F);
        List<RecommendData> recommendDatas = RecommendDataMgr.GetData();
        Transform itemParent = _ItemGameRecommend.transform.parent;
        for (int i = 0; i < recommendDatas.Count - 1; i++)
        {
            Instantiate(_ItemGameRecommend, itemParent);
        }
        for (int i = 0; i < itemParent.childCount; i++)
        {
            new ItemGameRecommend().Init(itemParent.GetChild(i).gameObject, recommendDatas[i]);
        }
        _TxtDate.text = System.DateTime.Now.ToString("yyyy.MM.dd");//20190529101211
    }


}
